<!-- header-section-starts -->
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ page import="entity.User" %>

<div class="header">
    <div class="container">
        <div class="logo">
            <a href="index.html"><img src="${pageContext.request.contextPath}/resource/img/friends/fr-09.jpg"
                                      class="img-responsive" alt="" style="width: 100px; height: 100px;margin-right: 20px;"/></a>
            <label style="margin-left: 200px;font-size: 40px;margin: 0;color: #ffffff;">看神马新闻</label>
        </div>
        <div class="header-right">
            <%
                User user = (User) session.getAttribute("user");
                if (user != null) {
            %>
            <h4 style="margin-right: -150px;margin-top: 13px"><span style="margin-left: 20px;font-size: 38px" ><%=user.getUserName()%></span>
                <ul class="pull-right top-menu" style="list-style:none;">
                    <li><a class="logout"
                           href="${pageContext.request.contextPath}/user/Logout?userName=<%=user.getUserName()%>">Logout</a>
                    </li>
                </ul>
            </h4>
            <%
            } else {
            %>
            <h4 style="margin-right: -200px;margin-top: 13px">
                <div style="margin-left: 20px;font-size: 38px">未登录</div>
                <ul class="pull-right top-menu" style="list-style: none">
                    <li style="">
                        <a class="logout" href="${pageContext.request.contextPath}/user/login1.html">ToLogin</a>
                        <a class="logout" href="${pageContext.request.contextPath}/user/register.html">ToRegister</a>
                    </li>

                </ul>
            </h4>
            <%
                }
            %>

            <span class="menu"></span>
            <div class="top-menu">
                <ul>
                    <li><a class="active" href="${pageContext.request.contextPath}/user/index.html">新闻主页</a></li>
<%--                    <li><a href="https://www.cnblogs.com/yangdagaoge/">项目日记</a></li>--%>
                 <li><a href="https://gitee.com/zheng_bin9812/news.git">项目地址</a></li>
                    <li><a href="${pageContext.request.contextPath}/user/center.html">个人中心</a></li>
                </ul>
            </div>
            <!-- script for menu -->
            <script>
                $("span.menu").click(function () {
                    $(".top-menu").slideToggle("slow", function () {
                        // Animation complete.
                    });
                });
            </script>
            <!-- script for menu -->
        </div>
        <div class="clearfix"></div>
    </div>
</div>
